package cc.sheji;

import cc.sheji.Service.UserService;
import cc.sheji.domain.User;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.poi.excel.ExcelReader;
import cn.hutool.poi.excel.ExcelUtil;
import cn.hutool.poi.excel.ExcelWriter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

import java.io.File;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

@EnableScheduling
@SpringBootApplication
public class WebApplication {

    @Autowired
    UserService userService;

    public static void main(String[] args) {
        SpringApplication.run(WebApplication.class, args);
    }

    @Scheduled(cron = "0 0 0 * * ?")
    public void doTask1() {
//        userService.updateInfo();
        userService.updateSignInfo();
        System.out.println("-----update user time-----");
    }

    @Scheduled(cron = "0 6 15 * * ?")
    public void doTask2() {

        System.out.println("-----update user time111-----");
    }

    @Scheduled(fixedRate = 10000)
    public void doTask() {
        userService.updateInfo1();
    }



}
